home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
Apps
/
ScreenSavers
/
bundle
/
Source
/
ScreenSaver.m
< prev
Wrap
Text File
|
1995-06-12
|
786b
|
47 lines
#import "ScreenSaver.h"
@implementation ScreenSaver
void runOneStep (DPSTimedEntry timedEntry, double timeNow, void *data);
- startScreenSaver
{
void runOneStep();
if( !timerRunning )
{
PShidecursor();
bouncingView = [[[[NXBundle bundleForClass: [self class]]
classNamed: "BouncingView"] alloc] init];
[bouncingView startScreenSaver];
timer = DPSAddTimedEntry(1.0 / 15.0, &runOneStep,
bouncingView, NX_BASETHRESHOLD);
timerRunning = YES;
}
return self;
}
- stopScreenSaver
{
if( timerRunning )
{
PSshowcursor();
DPSRemoveTimedEntry (timer);
timerRunning = NO;
[bouncingView stopScreenSaver];
[bouncingView free];
}
return self;
}
void runOneStep (DPSTimedEntry timedEntry, double timeNow, void *data)
{
[(id)data step];
}
@end